package com.sea.demo.shiro.form;

import java.util.Objects;

/**
 * @Author: 快乐在角落里
 * @Create: 2020/11/8 2:30
 * 权限相关表单对象
 */
public class PermissionForm {

    private Integer pid;/** 父节点id 根菜单为 0 */
    private Integer permissionType;/** 权限类型: 0:一级菜单 1:二级菜单 2:按钮 */
    private String permissionName;/** 节点名称 */
    private String permissionCode;/** 权限代码 */
    private String url;/** 权限地址 */
    private String description;/** 权限描述 */

    public PermissionForm() {
    }

    public PermissionForm(Integer pid, Integer permissionType, String permissionName, String permissionCode, String url, String description) {
        this.pid = pid;
        this.permissionType = permissionType;
        this.permissionName = permissionName;
        this.permissionCode = permissionCode;
        this.url = url;
        this.description = description;
    }

    @Override
    public String toString() {
        return "PermissionForm{" +
                "pid=" + pid +
                ", permissionType=" + permissionType +
                ", permissionName='" + permissionName + '\'' +
                ", permissionCode='" + permissionCode + '\'' +
                ", url='" + url + '\'' +
                ", description='" + description + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        PermissionForm that = (PermissionForm) o;
        return Objects.equals(pid, that.pid) &&
                Objects.equals(permissionType, that.permissionType) &&
                Objects.equals(permissionName, that.permissionName) &&
                Objects.equals(permissionCode, that.permissionCode) &&
                Objects.equals(url, that.url) &&
                Objects.equals(description, that.description);
    }

    @Override
    public int hashCode() {
        return Objects.hash(pid, permissionType, permissionName, permissionCode, url, description);
    }

    public Integer getPid() {
        return pid;
    }

    public void setPid(Integer pid) {
        this.pid = pid;
    }

    public Integer getPermissionType() {
        return permissionType;
    }

    public void setPermissionType(Integer permissionType) {
        this.permissionType = permissionType;
    }

    public String getPermissionName() {
        return permissionName;
    }

    public void setPermissionName(String permissionName) {
        this.permissionName = permissionName;
    }

    public String getPermissionCode() {
        return permissionCode;
    }

    public void setPermissionCode(String permissionCode) {
        this.permissionCode = permissionCode;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
